package cn.lcsjsxy.yxz.day.Set;

import java.util.ArrayList;
import java.util.HashSet;

//HashSet常用方法
public class HashSetCommonmethods {

    public static void main(String[] args) {

        HashSet<String> set = new  HashSet();

        ArrayList<String> list = new ArrayList();
        list.add("1");
        list.add("2");
        list.add("3");
        set.addAll(list);

        Object[] objects = set.toArray();
        System.out.println(set.isEmpty());
//        set.clear();
        set.contains("1");
        System.out.println(set.size());
        Object clone = set.clone();
        System.out.println(clone);

        //输出
        System.out.println(set);
    }
}
